package com.eci.context.asset.enums;

public enum UserTypeEnum {
	
	/**最大权限拥有者，拥有所有权限*/
	PLATF_ADMIN   ("1","平台超管"),
	/**平台级用户，挂根组织上*/
	PLATF_USER    ("2","平台用户"),
	/**每个集团里的权限最大拥有者，挂集团的根节点下*/
	COMPANY_ADMIN ("3","集团超管"),
	/**普通用户，挂部门或者岗位下*/
	GENERAL_USER  ("4","普通用户"); 
	
	private String key; 
	private String val;
	
	UserTypeEnum(String key,String val){
		this.key = key;
		this.val = val;
	}
	
	public String getKey() {
		return key;
	}

	public String getVal() {
		return val;
	}
	
    public static UserTypeEnum getByKey(String key) {  
        for(UserTypeEnum en : UserTypeEnum.values()){  
            if(en.key.equals(key)) {  
                return en;  
            }  
        }  
        throw new IllegalArgumentException("No element matches " + key);  
    }  

}
